package com.itheima;

/**
 * 2025/3/22 11:07
 * 案例-红绿灯
 */
public class RedYellowGreen {

    public static void main(String[] args) {
        boolean red = false;
        boolean yellow = true;
        boolean green = true;

        check(red, yellow, green);
    }

    public static void check(boolean red, boolean yellow, boolean green) {
        if (red) {
            System.out.println("红灯,请停止通行");
        } else if (yellow) {
            System.out.println("黄灯,请慢行");
        } else if (green) {
            System.out.println("绿灯,请通行");
        } else {
            System.out.println("灯故障,驾驶员请接管车辆");
        }
    }

}
